/**
* 版权声明：厦门睿商网络科技有限公司 版权所有 违者必究
* 日    期：2020-02-17
*/
package com.rzico.basics.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;

/**
 * <pre>
 *   供应商数据库对象
 * </pre>
 * @author Rzico Boot
 * @version 1.0
 */
@Data
@JsonIgnoreProperties(value = {"handler"})
@Table(name = "wx_supplier")
public class Supplier{
    @Id
    protected Long id;

    @ApiModelProperty(value = "创建日期", hidden = true)
    protected java.util.Date createDate;

    @ApiModelProperty(value = "修改日期", hidden = true)
    protected java.util.Date modifyDate;

    @ApiModelProperty(value = "供应商编号")
    protected String code;

    @ApiModelProperty(value = "供应商名称")
    protected String name;

    @ApiModelProperty(value = "备用电话")
    protected String phone;

    @ApiModelProperty(value = "邮箱")
    protected String email;

    @ApiModelProperty(value = "手机号")
    protected String mobile;

    @ApiModelProperty(value = "所在地")
    protected Integer areaId;

    @ApiModelProperty(value = "所在区")
    protected String areaName;

    @ApiModelProperty(value = "地址")
    protected String address;

    @ApiModelProperty(value = "绑定用户名")
    protected String username;

    @ApiModelProperty(value = "绑定用户ID")
    protected String userId;

    @ApiModelProperty(value = "收货人")
    protected String consignee;

    @ApiModelProperty(value = "所属分类")
    protected Long supplierCategoryId;

    @ApiModelProperty(value = "所属企业", hidden = true)
    protected Long enterpriseId;

    @ApiModelProperty(value = "开票类型:0.不开票,1.增票,2.普票")
    protected Integer taxType;

    @ApiModelProperty(value = "进项税率（%）")
    protected java.math.BigDecimal tax;

    @ApiModelProperty(value = "软删除", hidden = true)
    protected Boolean deleted;

    @ApiModelProperty(value = "创建者")
    @JsonIgnore
    protected String createBy;

    @ApiModelProperty(value = "更新者")
    @JsonIgnore
    protected String modifyBy;


    @ApiModelProperty(value = "供应商分类", hidden = true)
    @JsonIgnore
    protected SupplierCategory supplierCategory;


    @ApiModelProperty(value = "名称", hidden = true)
    public String getSupplierCategoryName(){
        SupplierCategory supplierCategory = getSupplierCategory();
        if (null != supplierCategory){
            return supplierCategory.getName();
        }else{
            return "";
        }
    }

    public void setSupplierCategoryName(String supplierCategoryName){

    }
}
